package model

import "gitee.com/zaiqiang231/zcamp-service-camp/app/model/meta"

type Condition struct {
	meta.RecordModel
	Status      int    `json:"status" gorm:"status"` // 状态：1预发布，2在线，3已下线
	ParentId    int64  `json:"parent_id" gorm:"parent_id"`
	Name        string `json:"name" gorm:"name"`
	Level       int    `json:"level" gorm:"level"`
	Sort        int    `json:"sort" gorm:"sort"`
	Pictures    string `json:"pictures" gorm:"pictures"` // json 图片/状态
	MultiSelect int    `json:"multi_select" gorm:"multi_select"`
}

func (Condition) TableName() string {
	return "z_condition"
}

type CampMapCondition struct {
	meta.RecordModel
	ConditionID int64 `json:"condition_id" gorm:"condition_id"`
	CampID      int64 `json:"camp_id" gorm:"camp_id"`
}

func (CampMapCondition) TableName() string {
	return "z_camp_map_condition"
}

type ConditionTree struct {
	Condition
	Children []*ConditionTree `json:"children" gorm:"-"`
}

type HotCondition struct {
	Condition
	ParentMultiSelect int `json:"parent_multi_select"`
}

type CampDetailCondition struct {
	Condition
	ParentName string `json:"parent_name"`
	Icon       string `json:"icon"`
	Value      int    `json:"value"`
}
